Skip to content

[BEAM-115] Runner API Translations for StateSpec and TimerSpec#3233

Merged
asfgit merged 6 commits into
apache:masterfrom
kennknowles:translate-StateSpec
May 26, 2017
Merged

[BEAM-115] Runner API Translations for StateSpec and TimerSpec#3233
asfgit merged 6 commits into
apache:masterfrom
kennknowles:translate-StateSpec

Conversation

@kennknowles
Copy link
Copy Markdown
Member

@kennknowles kennknowles commented May 26, 2017

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify.
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

R: @tgroh

The awkward bit is that a combining StateSpec is statically typed to take a CombineFn. So when we get around to issuing Fn State API requests, we'll need to work around that.

equalTo(protoComponents.getPcollectionsOrThrow(mainInputId)));
}

@Test
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are going to be run n times because the test as a whole is parameterized.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I'll probably move the parameterized bits into a sub-suite.

return builder.build();
}

private static Object getFieldOrCrash(Field field, Object target) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer something that hides the need for a cast (e.g. getStateFieldOrCrash(Field, DoFn))

This is different than a StateBinder: for a binder, the id is needed and
the StateSpec controls the return type. For case dispatch, the
dispatcher controls the type and it should just be reading the spec,
which does not require the id. Eventually, StateBinder could be removed
in favor of StateSpec.Cases<Function<String, StateT>>.
@kennknowles kennknowles force-pushed the translate-StateSpec branch from 5aa01d6 to f804f05 Compare May 26, 2017 17:22
@kennknowles kennknowles force-pushed the translate-StateSpec branch from f804f05 to 39220db Compare May 26, 2017 17:36
@asfgit asfgit merged commit 39220db into apache:master May 26, 2017
asfgit pushed a commit that referenced this pull request May 26, 2017
…nd TimerSpec

  Implement TimerSpec and StateSpec translation
  Make Java serialized CombineFn URN public
  Add case dispatch to StateSpec
  Flesh out TimerSpec and StateSpec in Runner API
  Allow translation to throw IOException
  Mark CombineFnWithContext StateSpecs internal
@coveralls
Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 39220db on kennknowles:translate-StateSpec into ** on apache:master**.

@kennknowles kennknowles deleted the translate-StateSpec branch May 31, 2017 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants